<ResourceDictionary
   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
   xmlns:c="comment"
   xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
   xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
   xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"
   xmlns:local="clr-namespace:LogoFX.Controls"
   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
   xmlns:Interactivity="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
   xmlns:Interactivity1="clr-namespace:LogoFX.Infra.Interactivity" 
   xmlns:fxui="clr-namespace:LogoFX.Controls.Animation"
   xmlns:Internal="clr-namespace:Internal" 
   mc:Ignorable="c">
  
    <SolidColorBrush x:Key="MenuPanelDropDownTriangleBrush" Color="#8d0223"/>
    <SolidColorBrush x:Key="ZoombarBorderBrush" Color="#CFD2D5"/>
    <SolidColorBrush x:Key="ZoombarBackgroundBrush" Color="#F2F6FA"/>
    <SolidColorBrush x:Key="ZoombarThumbBorderBrush" Color="#B2BCC5"/>
    <LinearGradientBrush x:Key="ZoombarThumbBackgroundBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientStop Offset="0.0" Color="#FAFAFB"/>
        <GradientStop Offset="1.0" Color="#DFE2E5"/>
    </LinearGradientBrush>
    <SolidColorBrush x:Key="ZoombarThumbFromBackgroundBrush" Color="#F9F9FA"/>
    <SolidColorBrush x:Key="ZoombarThumbToBackgroundBrush" Color="#DFE2E5"/>
    <LinearGradientBrush x:Key="ZoombarThumbFillerBackgroundBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientStop Offset="0.0" Color="#DFE2E5"/>
        <GradientStop Offset="1.0" Color="#FAFAFB"/>
    </LinearGradientBrush>
    <SolidColorBrush x:Key="ZoombarThumbHandleBackgroundBrush" Color="#C0C7CE"/>
    <SolidColorBrush x:Key="ZoombarThumbHandleTopBorderBrush" Color="#A6ACB3"/>
    <SolidColorBrush x:Key="ZoombarThumbHandleBottomBorderBrush" Color="#F2F3F4"/>
    <SolidColorBrush x:Key="SwitchboardBorderBrush" Color="#D7DBDE"/>
    <SolidColorBrush x:Key="SwitchboardBackgroundBrush" Color="#DDE6EC"/>
    <SolidColorBrush x:Key="SummaryBorderBrush" Color="#DBE1E6"/>
    <SolidColorBrush x:Key="SummaryTitleBackgroundBrush" Color="#437CA9"/>
    <SolidColorBrush x:Key="SummaryTitleColor" Color="#FFFFFF"/>
    <SolidColorBrush x:Key="SummaryBasicParameterColor" Color="#000000"/>
    <SolidColorBrush x:Key="SummaryBasicParameterUnitsColor" Color="#434343"/>
    <SolidColorBrush x:Key="SummaryMinMaxAvgBackgroundBrush" Color="#EEF2F4"/>
    <SolidColorBrush x:Key="SummaryMinMaxAvgLightBackgroundBrush" Color="#FFFFFF"/>
    <SolidColorBrush x:Key="SummaryMinMaxAvgColor" Color="#000000"/>
    <SolidColorBrush x:Key="SummaryMinMaxAvgNameColor" Color="#434343"/>
    <Internal:BoolToVisibilityConverter x:Key="boolToVisibilityConverter">
    </Internal:BoolToVisibilityConverter>
    <Internal:BoolToConstConverter x:Key="btcc">
    </Internal:BoolToConstConverter>
    <Internal:BoolToVisibilityConverter x:Key="btvc">
    </Internal:BoolToVisibilityConverter>
    <DataTemplate x:Key="EmptyTemplate">
        <Grid>
        </Grid>
    </DataTemplate>
    <ControlTemplate x:Key="CommonValidationToolTipTemplate" TargetType="ToolTip">
        <Grid
           x:Name="Root"
           Margin="5,0"
           Opacity="0"
           RenderTransformOrigin="0,0">
            <Grid.RenderTransform>
                <TranslateTransform x:Name="Translation" X="-25"/>
            </Grid.RenderTransform>
            <vsm:VisualStateManager.VisualStateGroups>
                <vsm:VisualStateGroup x:Name="OpenStates">
                    <vsm:VisualStateGroup.Transitions>
                        <vsm:VisualTransition GeneratedDuration="0"/>
                        <vsm:VisualTransition GeneratedDuration="0:0:0.2" To="Open">
                            <Storyboard>
                                <DoubleAnimation
                                   Duration="0:0:0.2"
                                   Storyboard.TargetName="Translation"
                                   Storyboard.TargetProperty="X"
                                   To="0">
                                    <DoubleAnimation.EasingFunction>
                                        <BackEase Amplitude=".3" EasingMode="EaseOut"/>
                                    </DoubleAnimation.EasingFunction>
                                </DoubleAnimation>
                                <DoubleAnimation
                                   Duration="0:0:0.2"
                                   Storyboard.TargetName="Root"
                                   Storyboard.TargetProperty="Opacity"
                                   To="1"/>
                            </Storyboard>
                        </vsm:VisualTransition>
                    </vsm:VisualStateGroup.Transitions>
                    <vsm:VisualState x:Name="Closed">
                        <Storyboard>
                            <DoubleAnimation
                               Duration="0"
                               Storyboard.TargetName="Root"
                               Storyboard.TargetProperty="Opacity"
                               To="0"/>
                        </Storyboard>
                    </vsm:VisualState>
                    <vsm:VisualState x:Name="Open">
                        <Storyboard>
                            <DoubleAnimation
                               Duration="0"
                               Storyboard.TargetName="Translation"
                               Storyboard.TargetProperty="X"
                               To="0"/>
                            <DoubleAnimation
                               Duration="0"
                               Storyboard.TargetName="Root"
                               Storyboard.TargetProperty="Opacity"
                               To="1"/>
                        </Storyboard>
                    </vsm:VisualState>
                </vsm:VisualStateGroup>
            </vsm:VisualStateManager.VisualStateGroups>
            <Border Margin="4,4,-4,-4" Background="#052A2E31" CornerRadius="5"/>
            <Border Margin="3,3,-3,-3" Background="#152A2E31" CornerRadius="4"/>
            <Border Margin="2,2,-2,-2" Background="#252A2E31" CornerRadius="3"/>
            <Border Margin="1,1,-1,-1" Background="#352A2E31" CornerRadius="2"/>
            <Border Background="#FFDC000C" CornerRadius="2">
                <TextBlock
                   MaxWidth="250"
                   Margin="8,4,8,4"
                   Foreground="White"
                   Text="{Binding (Validation.Errors)[0].ErrorContent}"
                   TextWrapping="Wrap"
                   UseLayoutRounding="false"/>
            </Border>
        </Grid>
    </ControlTemplate>
    <Style TargetType="local:ImageButton">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:ImageButton">
                    <Grid x:Name="rootGrid">
                        <vsm:VisualStateManager.VisualStateGroups>
                            <vsm:VisualStateGroup x:Name="CommonStates">
                                <vsm:VisualStateGroup.Transitions>
                                    <vsm:VisualTransition From="Normal" GeneratedDuration="00:00:00" To="Pressed"/>
                                    <vsm:VisualTransition From="Pressed" GeneratedDuration="00:00:00" To="Normal"/>
                                </vsm:VisualStateGroup.Transitions>
                                <vsm:VisualState x:Name="Normal"/>
                                <vsm:VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="NormalImage" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="HoverImage" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="NormalImage" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="HoverImage" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="PressedImage" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="NormalImage" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="HoverImage" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="PressedImage" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="DisabledImage" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation
                                           Duration="0"
                                           Storyboard.TargetName="content"
                                           Storyboard.TargetProperty="Opacity"
                                           To=".55"/>
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                        </vsm:VisualStateManager.VisualStateGroups>
                        <Grid x:Name="content" Margin="{TemplateBinding Padding}">
                            <!--<Canvas>-->
                            <Image x:Name="NormalImage" Source="{TemplateBinding NormalImage}"/>
                            <Image x:Name="HoverImage" Source="{TemplateBinding HoverImage}" Visibility="Collapsed"/>
                            <Image x:Name="PressedImage" Source="{TemplateBinding PressedImage}" Visibility="Collapsed"/>
                            <Image x:Name="DisabledImage" Source="{TemplateBinding DisabledImage}" Visibility="Collapsed"/>
                            <!--</Canvas>-->
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="local:ImageToggleButton">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:ImageToggleButton">
                    <Grid x:Name="rootGrid">
                        <vsm:VisualStateManager.VisualStateGroups>
                            <vsm:VisualStateGroup x:Name="CommonStates">
                                <vsm:VisualStateGroup.Transitions>
                                    <vsm:VisualTransition From="Normal" GeneratedDuration="00:00:00" To="Pressed"/>
                                    <vsm:VisualTransition From="Pressed" GeneratedDuration="00:00:00" To="Normal"/>
                                </vsm:VisualStateGroup.Transitions>
                                <vsm:VisualState x:Name="Normal"/>
                                <vsm:VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="NormalImage" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="HoverImage" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="NormalImage" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="HoverImage" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="PressedImage" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="NormalImage" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="HoverImage" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="PressedImage" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="DisabledImage" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation
                                           Duration="0"
                                           Storyboard.TargetName="content"
                                           Storyboard.TargetProperty="Opacity"
                                           To=".55"/>
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                        </vsm:VisualStateManager.VisualStateGroups>
                        <Grid x:Name="content" Margin="{TemplateBinding Padding}">
                            <!--<Canvas>-->
                            <Image x:Name="NormalImage" Source="{TemplateBinding NormalImage}">
                            </Image>
                            <Image x:Name="HoverImage" Source="{TemplateBinding HoverImage}" Visibility="Collapsed">
                            </Image>
                            <Image x:Name="PressedImage" Source="{TemplateBinding PressedImage}" Visibility="Collapsed">
                            </Image>
                            <Image x:Name="DisabledImage" Source="{TemplateBinding DisabledImage}" Visibility="Collapsed">
                            </Image>
                            <!--</Canvas>-->
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="local:ZoomBar">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:ZoomBar">
                    <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                        <!--DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}">-->
                        <!--<Border CornerRadius="1,1,1,1" 
                  BorderThickness="1" 
                  BorderBrush="{StaticResource ZoombarBorderBrush}" 
                  Background="{StaticResource ZoombarBackgroundBrush}">-->
                        <Grid>
                            <ContentPresenter Content="{TemplateBinding PreviewContent}">
                            </ContentPresenter>
                            <Grid x:Name="ZoombarTemplate">
                                <Interactivity:Interaction.Behaviors>
                                    <Interactivity1:MeasurementBehavior></Interactivity1:MeasurementBehavior>
                                </Interactivity:Interaction.Behaviors>

                                <Grid.Resources>
                                    <ControlTemplate x:Key="ZoombarRangeThumbTemplate" TargetType="controls:GridSplitter">
                                        <Grid>
                                            <VisualStateManager.VisualStateGroups>
                                                <VisualStateGroup x:Name="CommonStates">
                                                    <VisualState x:Name="Normal"/>
                                                    <VisualState x:Name="MouseOver"/>
                                                    <VisualState x:Name="Disabled"/>
                                                </VisualStateGroup>
                                            </VisualStateManager.VisualStateGroups>
                                            <!--<Rectangle x:Name="DisabledOverlay" Visibility="Collapsed" Opacity=".55" Stroke="#FFA3AEB9" Fill="White" />-->
                                            <Grid
                                               HorizontalAlignment="Stretch"
                                               VerticalAlignment="Stretch"
                                               Cursor="Hand"
                                               Visibility="Collapsed">
                                                <Grid.Effect>
                                                    <DropShadowEffect
                                                       BlurRadius="1"
                                                       Color="Gray"
                                                       Direction="-20"
                                                       Opacity="1"
                                                       ShadowDepth="2">
                                                    </DropShadowEffect>
                                                </Grid.Effect>
                                                <Grid.ColumnDefinitions>
                                                    <ColumnDefinition Width="5"/>
                                                    <ColumnDefinition/>
                                                    <ColumnDefinition Width="5"/>
                                                </Grid.ColumnDefinitions>
                                                <Grid.RowDefinitions>
                                                    <RowDefinition Height="5"/>
                                                    <RowDefinition/>
                                                    <RowDefinition Height="5"/>
                                                </Grid.RowDefinitions>
                                                <Border
                                                   Grid.Column="0"
                                                   Grid.ColumnSpan="2"
                                                   Grid.Row="0"
                                                   Background="AliceBlue"
                                                   BorderBrush="SteelBlue"
                                                   BorderThickness="1,1,0,0"
                                                   CornerRadius="2,0,0,0"
                                                   Opacity="0.9">
                                                </Border>
                                                <Border
                                                   Grid.Column="2"
                                                   Grid.Row="0"
                                                   Grid.RowSpan="2"
                                                   Background="AliceBlue"
                                                   BorderBrush="SteelBlue"
                                                   BorderThickness="0,1,1,0"
                                                   CornerRadius="0,2,0,0"
                                                   Opacity="0.9">
                                                </Border>
                                                <Border
                                                   Grid.Column="1"
                                                   Grid.ColumnSpan="2"
                                                   Grid.Row="2"
                                                   Background="AliceBlue"
                                                   BorderBrush="SteelBlue"
                                                   BorderThickness="0,0,1,1"
                                                   CornerRadius="0,0,2,0"
                                                   Opacity="0.9">
                                                </Border>
                                                <Border
                                                   Grid.Column="0"
                                                   Grid.Row="1"
                                                   Grid.RowSpan="2"
                                                   Background="AliceBlue"
                                                   BorderBrush="SteelBlue"
                                                   BorderThickness="1,0,0,1"
                                                   CornerRadius="0,0,0,2"
                                                   Opacity="0.9">
                                                </Border>
                                                <Border
                                                   Grid.Column="1"
                                                   Grid.Row="1"
                                                   Background="Transparent"
                                                   BorderBrush="SteelBlue"
                                                   BorderThickness="1,1,1,1"
                                                   CornerRadius="2">
                                                </Border>
                                            </Grid>
                                            <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Cursor="Hand">
                                                <Grid.ColumnDefinitions>
                                                    <ColumnDefinition Width="3"/>
                                                    <ColumnDefinition/>
                                                    <ColumnDefinition Width="3"/>
                                                </Grid.ColumnDefinitions>
                                                <Grid.RowDefinitions>
                                                    <RowDefinition Height="5"/>
                                                    <RowDefinition/>
                                                    <RowDefinition Height="5"/>
                                                </Grid.RowDefinitions>
                                                <Border
                                                   Grid.Column="0"
                                                   Grid.ColumnSpan="3"
                                                   Grid.Row="0"
                                                   Background="{StaticResource ZoombarThumbFromBackgroundBrush}"
                                                   BorderBrush="{StaticResource ZoombarThumbBorderBrush}"
                                                   BorderThickness="0,1,0,0"/>
                                                <Border
                                                   Grid.Column="0"
                                                   Grid.ColumnSpan="3"
                                                   Grid.Row="2"
                                                   Background="{StaticResource ZoombarThumbToBackgroundBrush}"
                                                   BorderBrush="{StaticResource ZoombarThumbBorderBrush}"
                                                   BorderThickness="0,0,0,1"/>
                                                <Border
                                                   Grid.Column="0"
                                                   Grid.ColumnSpan="3"
                                                   Grid.Row="1"
                                                   Background="{StaticResource ZoombarThumbFillerBackgroundBrush}"
                                                   BorderBrush="{StaticResource ZoombarThumbBorderBrush}"
                                                   BorderThickness="0,0,0,0"
                                                   CornerRadius="1"
                                                   Opacity="0.5"/>
                                                <Border
                                                   Grid.Column="0"
                                                   Grid.ColumnSpan="3"
                                                   Grid.Row="1"
                                                   Background="Transparent"
                                                   BorderBrush="{StaticResource ZoombarThumbBorderBrush}"
                                                   BorderThickness="1,1,1,1"
                                                   CornerRadius="1"/>
                                            </Grid>
                                        </Grid>
                                    </ControlTemplate>
                                    <ControlTemplate x:Key="ZoombarLeftThumbTemplate" TargetType="controls:GridSplitter">
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="4*"/>
                                                <ColumnDefinition Width="3*"/>
                                                <ColumnDefinition Width="3*"/>
                                            </Grid.ColumnDefinitions>
                                            <Grid.RowDefinitions>
                                                <RowDefinition/>
                                                <RowDefinition/>
                                                <RowDefinition/>
                                            </Grid.RowDefinitions>
                                            <Border
                                               Grid.Column="0"
                                               Grid.ColumnSpan="3"
                                               Grid.Row="0"
                                               Grid.RowSpan="3"
                                               Background="{StaticResource ZoombarThumbBackgroundBrush}"
                                               BorderBrush="{StaticResource ZoombarThumbBorderBrush}"
                                               BorderThickness="1,1,0,1"
                                               CornerRadius="3,0,0,3"/>
                                            <Border Grid.Column="1" Grid.Row="1" Background="{StaticResource ZoombarThumbHandleBackgroundBrush}"/>
                                        </Grid>
                                    </ControlTemplate>
                                    <ControlTemplate x:Key="ZoombarRightThumbTemplate" TargetType="controls:GridSplitter">
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="3*"/>
                                                <ColumnDefinition Width="3*"/>
                                                <ColumnDefinition Width="4*"/>
                                            </Grid.ColumnDefinitions>
                                            <Grid.RowDefinitions>
                                                <RowDefinition/>
                                                <RowDefinition/>
                                                <RowDefinition/>
                                            </Grid.RowDefinitions>
                                            <Border
                                               Grid.Column="0"
                                               Grid.ColumnSpan="3"
                                               Grid.Row="0"
                                               Grid.RowSpan="3"
                                               Background="{StaticResource ZoombarThumbBackgroundBrush}"
                                               BorderBrush="{StaticResource ZoombarThumbBorderBrush}"
                                               BorderThickness="0,1,1,1"
                                               CornerRadius="0,3,3,0"/>
                                            <Border Grid.Column="1" Grid.Row="1" Background="{StaticResource ZoombarThumbHandleBackgroundBrush}"/>
                                        </Grid>
                                    </ControlTemplate>
                                </Grid.Resources>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition x:Name="LowerPart" MinWidth="10"/>
                                    <ColumnDefinition x:Name="RangePart"/>
                                    <ColumnDefinition x:Name="UpperPart" MinWidth="10"/>
                                </Grid.ColumnDefinitions>
                                <Border
                                   x:Name="LowerBorder"
                                   Grid.Column="0"
                                   HorizontalAlignment="Stretch"
                                   VerticalAlignment="Stretch"
                                   Background="LightGray"
                                   Opacity="0.2"/>
                                <Border
                                   x:Name="UpperBorder"
                                   Grid.Column="2"
                                   HorizontalAlignment="Stretch"
                                   VerticalAlignment="Stretch"
                                   Background="LightGray"
                                   Opacity="0.2"/>
                                <controls:GridSplitter
                                   x:Name="LowerThumb"
                                   Width="10"
                                   Grid.Column="0"
                                   HorizontalAlignment="Right"
                                   Template="{StaticResource ZoombarLeftThumbTemplate}"/>
                                <Grid
                                   x:Name="Measurer"
                                   Grid.Column="1"
                                   HorizontalAlignment="Stretch"
                                   Background="Transparent">
                                    <Interactivity:Interaction.Behaviors>
                                        <Interactivity1:MeasurementBehavior></Interactivity1:MeasurementBehavior>
                                    </Interactivity:Interaction.Behaviors>
                                </Grid>
                                <controls:GridSplitter
                                   Width="{Binding ElementName=Measurer, Path=(Interactivity1:MeasurementBehavior.ActualWidth)}"
                                   Grid.Column="1"
                                   HorizontalAlignment="Center"
                                   Template="{StaticResource ZoombarRangeThumbTemplate}"/>
                                <controls:GridSplitter
                                   x:Name="UpperThumb"
                                   Width="10"
                                   Grid.Column="2"
                                   HorizontalAlignment="Left"
                                   Template="{StaticResource ZoombarRightThumbTemplate}"/>
                            </Grid>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>    
    <Style TargetType="local:BusyAnimation">
        <!--<Setter Property="IsRunning" Value="False" />-->
        <Setter Property="StepInterval" Value="100"/>
        <Setter Property="Foreground" Value="Gray"/>
        <Setter Property="Background" Value="Transparent"/>
        <!--<Setter Property="BorderBrush" Value="Black" />
    <Setter Property="BorderThickness" Value=".5" />-->
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:BusyAnimation">
                    <Grid x:Name="Root" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                        <Grid.Resources>
                            <Internal:BoolToConstConverter x:Key="BoolToConstConverter">
                            </Internal:BoolToConstConverter>
                        </Grid.Resources>
                        <vsm:VisualStateManager.VisualStateGroups>
                            <vsm:VisualStateGroup x:Name="CommonStates">
                                <vsm:VisualState x:Name="normal">
                                    <Storyboard/>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="state1">
                                    <Storyboard>
                                        <DoubleAnimation
                                           Duration="0"
                                           From="0"
                                           Storyboard.TargetName="part6"
                                           Storyboard.TargetProperty="Opacity"
                                           To=".25"/>
                                        <DoubleAnimation
                                           Duration="0"
                                           From="0"
                                           Storyboard.TargetName="part7"
                                           Storyboard.TargetProperty="Opacity"
                                           To=".5"/>
                                        <DoubleAnimation
                                           Duration="0"
                                           From="0"
                                           Storyboard.TargetName="part8"
                                           Storyboard.TargetProperty="Opacity"
                                           To=".75"/>
                                        <DoubleAnimation
                                           Duration="0"
                                           From="0"
                                           Storyboard.TargetName="part1"
                                           Storyboard.TargetProperty="Opacity"
                                           To="1"/>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="state2">
                                    <Storyboard>
                                        <DoubleAnimation
                                           Duration="0"
                                           From="0"
                                           Storyboard.TargetName="part7"
                                           Storyboard.TargetProperty="Opacity"
                                           To=".25"/>
                                        <DoubleAnimation
                                           Duration="0"
                                           From="0"
                                           Storyboard.TargetName="part8"
                                           Storyboard.TargetProperty="Opacity"
                                           To=".5"/>
                                        <DoubleAnimation
                                           Duration="0"
                                           From="0"
                                           Storyboard.TargetName="part1"
                                           Storyboard.TargetProperty="Opacity"
                                           To=".75"/>
                                        <DoubleAnimation
                                           Duration="0"
                                           From="0"
                                           Storyboard.TargetName="part2"
                                           Storyboard.TargetProperty="Opacity"
                                           To="1"/>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="state3">
                                    <Storyboard>
                                        <DoubleAnimation
                                           Duration="0"
                                           From="0"
                                           Storyboard.TargetName="part8"
                                           Storyboard.TargetProperty="Opacity"
                                           To=".25"/>
                                        <DoubleAnimation
                                           Duration="0"
                                           From="0"
                                           Storyboard.TargetName="part1"
                                           Storyboard.TargetProperty="Opacity"
                                           To=".5"/>
                                        <DoubleAnimation
                                           Duration="0"
                                           From="0"
                                           Storyboard.TargetName="part2"
                                           Storyboard.TargetProperty="Opacity"
                                           To=".75"/>
                                        <DoubleAnimation
                                           Duration="0"
                                           From="0"
                                           Storyboard.TargetName="part3"
                                           Storyboard.TargetProperty="Opacity"
                                           To="1"/>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="state4">
                                    <Storyboard>
                                        <DoubleAnimation
                                           Duration="0"
                                           From="0"
                                           Storyboard.TargetName="part1"
                                           Storyboard.TargetProperty="Opacity"
                                           To=".25"/>
                                        <DoubleAnimation
                                           Duration="0"
                                           From="0"
                                           Storyboard.TargetName="part2"
                                           Storyboard.TargetProperty="Opacity"
                                           To=".5"/>
                                        <DoubleAnimation
                                           Duration="0"
                                           From="0"
                                           Storyboard.TargetName="part3"
                                           Storyboard.TargetProperty="Opacity"
                                           To=".75"/>
                                        <DoubleAnimation
                                           Duration="0"
                                           From="0"
                                           Storyboard.TargetName="part4"
                                           Storyboard.TargetProperty="Opacity"
                                           To="1"/>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="state5">
                                    <Storyboard>
                                        <DoubleAnimation
                                           Duration="0"
                                           From="0"
                                           Storyboard.TargetName="part2"
                                           Storyboard.TargetProperty="Opacity"
                                           To=".25"/>
                                        <DoubleAnimation
                                           Duration="0"
                                           From="0"
                                           Storyboard.TargetName="part3"
                                           Storyboard.TargetProperty="Opacity"
                                           To=".5"/>
                                        <DoubleAnimation
                                           Duration="0"
                                           From="0"
                                           Storyboard.TargetName="part4"
                                           Storyboard.TargetProperty="Opacity"
                                           To=".75"/>
                                        <DoubleAnimation
                                           Duration="0"
                                           From="0"
                                           Storyboard.TargetName="part5"
                                           Storyboard.TargetProperty="Opacity"
                                           To="1"/>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="state6">
                                    <Storyboard>
                                        <DoubleAnimation
                                           Duration="0"
                                           From="0"
                                           Storyboard.TargetName="part3"
                                           Storyboard.TargetProperty="Opacity"
                                           To=".25"/>
                                        <DoubleAnimation
                                           Duration="0"
                                           From="0"
                                           Storyboard.TargetName="part4"
                                           Storyboard.TargetProperty="Opacity"
                                           To=".5"/>
                                        <DoubleAnimation
                                           Duration="0"
                                           From="0"
                                           Storyboard.TargetName="part5"
                                           Storyboard.TargetProperty="Opacity"
                                           To=".75"/>
                                        <DoubleAnimation
                                           Duration="0"
                                           From="0"
                                           Storyboard.TargetName="part6"
                                           Storyboard.TargetProperty="Opacity"
                                           To="1"/>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="state7">
                                    <Storyboard>
                                        <DoubleAnimation
                                           Duration="0"
                                           From="0"
                                           Storyboard.TargetName="part4"
                                           Storyboard.TargetProperty="Opacity"
                                           To=".25"/>
                                        <DoubleAnimation
                                           Duration="0"
                                           From="0"
                                           Storyboard.TargetName="part5"
                                           Storyboard.TargetProperty="Opacity"
                                           To=".5"/>
                                        <DoubleAnimation
                                           Duration="0"
                                           From="0"
                                           Storyboard.TargetName="part6"
                                           Storyboard.TargetProperty="Opacity"
                                           To=".75"/>
                                        <DoubleAnimation
                                           Duration="0"
                                           From="0"
                                           Storyboard.TargetName="part7"
                                           Storyboard.TargetProperty="Opacity"
                                           To="1"/>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="state8">
                                    <Storyboard>
                                        <DoubleAnimation
                                           Duration="0"
                                           From="0"
                                           Storyboard.TargetName="part5"
                                           Storyboard.TargetProperty="Opacity"
                                           To=".25"/>
                                        <DoubleAnimation
                                           Duration="0"
                                           From="0"
                                           Storyboard.TargetName="part6"
                                           Storyboard.TargetProperty="Opacity"
                                           To=".5"/>
                                        <DoubleAnimation
                                           Duration="0"
                                           From="0"
                                           Storyboard.TargetName="part7"
                                           Storyboard.TargetProperty="Opacity"
                                           To=".75"/>
                                        <DoubleAnimation
                                           Duration="0"
                                           From="0"
                                           Storyboard.TargetName="part8"
                                           Storyboard.TargetProperty="Opacity"
                                           To="1"/>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualStateGroup.Transitions>
                                    <vsm:VisualTransition GeneratedDuration="0:0:0"/>
                                </vsm:VisualStateGroup.Transitions>
                            </vsm:VisualStateGroup>
                        </vsm:VisualStateManager.VisualStateGroups>
                        <ContentPresenter
                           x:Name="content"
                           HorizontalAlignment="Stretch"
                           VerticalAlignment="Stretch"
                           Content="{TemplateBinding Content}"
                           Opacity="{Binding RelativeSource={RelativeSource TemplatedParent},Path=IsRunning,Converter={StaticResource BoolToConstConverter},ConverterParameter=0.6}"/>
                        <Canvas
                           x:Name="part_container"
                           HorizontalAlignment="Stretch"
                           Margin="{TemplateBinding Padding}"
                           VerticalAlignment="Stretch"
                           Background="{TemplateBinding Background}"
                           IsHitTestVisible="True"
                           Visibility="{Binding RelativeSource={RelativeSource TemplatedParent},Path=IsRunning,Converter={StaticResource boolToVisibilityConverter}}">
                            <Ellipse
                               x:Name="part1"
                               Fill="{TemplateBinding Foreground}"
                               Opacity="0"
                               Stroke="{TemplateBinding BorderBrush}"
                               StrokeThickness="{TemplateBinding BorderThickness}"
                               Visibility="{TemplateBinding Visibility}"/>
                            <Ellipse
                               x:Name="part2"
                               Fill="{TemplateBinding Foreground}"
                               Opacity="0"
                               Stroke="{TemplateBinding BorderBrush}"
                               StrokeThickness="{TemplateBinding BorderThickness}"
                               Visibility="{TemplateBinding Visibility}"/>
                            <Ellipse
                               x:Name="part3"
                               Fill="{TemplateBinding Foreground}"
                               Opacity="0"
                               Stroke="{TemplateBinding BorderBrush}"
                               StrokeThickness="{TemplateBinding BorderThickness}"
                               Visibility="{TemplateBinding Visibility}"/>
                            <Ellipse
                               x:Name="part4"
                               Fill="{TemplateBinding Foreground}"
                               Opacity="0"
                               Stroke="{TemplateBinding BorderBrush}"
                               StrokeThickness="{TemplateBinding BorderThickness}"
                               Visibility="{TemplateBinding Visibility}"/>
                            <Ellipse
                               x:Name="part5"
                               Fill="{TemplateBinding Foreground}"
                               Opacity="0"
                               Stroke="{TemplateBinding BorderBrush}"
                               StrokeThickness="{TemplateBinding BorderThickness}"
                               Visibility="{TemplateBinding Visibility}"/>
                            <Ellipse
                               x:Name="part6"
                               Fill="{TemplateBinding Foreground}"
                               Opacity="0"
                               Stroke="{TemplateBinding BorderBrush}"
                               StrokeThickness="{TemplateBinding BorderThickness}"
                               Visibility="{TemplateBinding Visibility}"/>
                            <Ellipse
                               x:Name="part7"
                               Fill="{TemplateBinding Foreground}"
                               Opacity="0"
                               Stroke="{TemplateBinding BorderBrush}"
                               StrokeThickness="{TemplateBinding BorderThickness}"
                               Visibility="{TemplateBinding Visibility}"/>
                            <Ellipse
                               x:Name="part8"
                               Fill="{TemplateBinding Foreground}"
                               Opacity="0"
                               Stroke="{TemplateBinding BorderBrush}"
                               StrokeThickness="{TemplateBinding BorderThickness}"
                               Visibility="{TemplateBinding Visibility}"/>
                        </Canvas>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="local:GroupBox">
        <Setter Property="BorderBrush" Value="DarkGray"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Padding" Value="6"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:GroupBox">
                    <Grid Background="{TemplateBinding Background}">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <Border
                           Grid.Row="1"
                           Grid.RowSpan="2"
                           BorderBrush="{TemplateBinding BorderBrush}"
                           BorderThickness="{TemplateBinding BorderThickness}"
                           CornerRadius="3">
                            <Border.Clip>
                                <GeometryGroup FillRule="EvenOdd">
                                    <RectangleGeometry x:Name="FullRect" Rect="0,0,300,200"/>
                                    <RectangleGeometry x:Name="HeaderRect" Rect="6,0,100,100"/>
                                </GeometryGroup>
                            </Border.Clip>
                        </Border>
                        <ContentPresenter
                           Grid.Row="2"
                           Margin="{TemplateBinding Padding}"
                           Content="{TemplateBinding Content}"
                           ContentTemplate="{TemplateBinding ContentTemplate}"/>
                        <ContentControl
                           x:Name="HeaderContainer"
                           Grid.Row="0"
                           Grid.RowSpan="2"
                           HorizontalAlignment="Left"
                           Margin="6,0,0,0">
                            <ContentPresenter Margin="3,0,3,0" Content="{TemplateBinding Header}" ContentTemplate="{TemplateBinding HeaderTemplate}"/>
                        </ContentControl>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    
    <Style TargetType="local:PopupHeaderedContentControl">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:PopupHeaderedContentControl">
                    <Border Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}">
                        <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                            <ContentControl Content="{TemplateBinding Header}" ContentTemplate="{TemplateBinding HeaderTemplate}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" HorizontalContentAlignment="Stretch"></ContentControl>
                            <Canvas>
                                <Popup x:Name="Popup" HorizontalOffset="{TemplateBinding PopupHorizontalOffset}" VerticalOffset="{TemplateBinding PopupVerticalOffset}">
                                    <Grid>
                                        <Border
                                                            x:Name="ShadowBorder"
                                                            HorizontalAlignment="Stretch"
                                                            Opacity="1.0"
                                                            BorderThickness="0">
                                            <Border.Effect>
                                                <DropShadowEffect></DropShadowEffect>
                                            </Border.Effect>
                                        </Border>
                                        <Border
                                                              x:Name="PopupBorder"
                                                              HorizontalAlignment="Stretch"
                                                              Opacity="1.0"
                                                              BorderThickness="0">
                                            <Border.RenderTransform>
                                                <TranslateTransform X="1" Y="1" />
                                            </Border.RenderTransform>
                                            <Border.Background>
                                                <SolidColorBrush Color="#11000000" />
                                            </Border.Background>
                                            <Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}">
                                                <ContentControl Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" HorizontalContentAlignment="Stretch" HorizontalAlignment="Stretch">
                                                </ContentControl>
                                            </Border>
                                        </Border>
                                    </Grid>
                                </Popup>
                            </Canvas>
                            <Border x:Name="ClickHandler" Cursor="Hand" BorderThickness="0" Background="Transparent" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"></Border>
                        </Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="PopupStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0:0:0.1" To="PopupOpened" />
                                    <VisualTransition GeneratedDuration="0:0:0.2" To="PopupClosed" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="PopupOpened">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="PopupBorder" Storyboard.TargetProperty="Opacity" To="1.0" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="PopupClosed">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="PopupBorder" Storyboard.TargetProperty="Opacity" To="0.0" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                    </Border>

                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="local:NotificationContainer">
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate >
                    <local:NotificationContainerPanel />
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:NotificationContainer">
                    <Border Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}">
                        <ItemsPresenter />
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="local:NotificationItem">
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:NotificationItem">
                    <Border x:Name="_layoutRoot"
                            Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="*" />
                            </Grid.RowDefinitions>

                            <!--Header-->
                            <ContentPresenter Grid.Row="0"
                                              Content="{TemplateBinding Header}"
                                              ContentTemplate="{TemplateBinding HeaderTemplate}"/>

                            <!--Content-->
                            <ContentPresenter Grid.Row="1"
                                              Content="{TemplateBinding Content}"
                                              ContentTemplate="{TemplateBinding ContentTemplate}"/>
                        </Grid>

                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
  
  <Style TargetType="fxui:ContentView">
    <Setter Property="HorizontalAlignment" Value="Stretch"/>
    <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
    <Setter Property="VerticalAlignment" Value="Stretch"/>
    <Setter Property="VerticalContentAlignment" Value="Stretch"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="fxui:ContentView">
          <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
            <ContentPresenter x:Name="BackPresenter"
              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
            <ContentPresenter x:Name="FrontPresenter"                              
              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

</ResourceDictionary>
